package field.objects;

import util.Constants;

import com.badlogic.gdx.graphics.GLTexture;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class EnemyShip extends Ship {
    private float translateX;
    private float translateY;

    public EnemyShip(float x, float y, float translateX, float translateY, Texture shipTexture) {
        super(shipTexture);
        setTranslateX(translateX);
        setTranslateY(translateY);
        setX(x);
        setY(y);
        load();
    }

    public EnemyShip(Texture shipTexture) {
        super(shipTexture);
        setTranslateX(0);
        setTranslateY(-.9f);
        setX(Constants.WIDTH / 2);
        setY(Constants.HEIGHT);
        load();
    }

    public float getTranslateX() {
        return translateX;
    }

    public void setTranslateX(float translateX) {
        this.translateX = translateX;
    }

    public float getTranslateY() {
        return translateY;
    }

    public void setTranslateY(float translateY) {
        this.translateY = translateY;
    }

    @Override
    public void render(SpriteBatch batch) {
        translateX(translateX);
        translateY(translateY);
        draw(batch);
    }

    @Override
    public void load() {
        GLTexture.setEnforcePotImages(false);
        getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
        // Resizing the image to %75 from original (82,121)
        setSize(62, 91);
        setPosition(getX(), getY());
    }

    @Override
    public void dispose() {
        getTexture().dispose();
    }
}
